//
//  DCCycleScrollViewCell.m
//  DCCycleScrollView
//
//  Created by LT on 2019/3/27.
//  Copyright © 2019年 LT. All rights reserved.
//

#import "DCCycleScrollViewCell.h"
#import <AVFoundation/AVFoundation.h>
@interface DCCycleScrollViewCell()

@end

@implementation DCCycleScrollViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    if(self = [super initWithFrame:frame])
        
    {   [self.contentView addSubview:self.shadowView];
        [self.contentView addSubview:self.imageView];
        
    }
    return self;
}
//-(void)layoutSubviews
//{
//    self.imageView.frame = self.bounds;
//
////    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.imageView.bounds cornerRadius:self.imgCornerRadius];
////    CAShapeLayer *maskLayer = [[CAShapeLayer alloc]init];
////    //设置大小
////    maskLayer.frame = self.bounds;
////    //设置图形样子
////    maskLayer.path = maskPath.CGPath;
////    _imageView.layer.mask = maskLayer;
//
//
//    
//}

-(UIImageView *)imageView
{
    if(_imageView == nil)
    {
        _imageView = [[UIImageView alloc]init];
        //_imageView.frame=self.bounds;
        _imageView.frame=CGRectMake(self.bounds.origin.x, self.bounds.origin.y+30, self.bounds.size.width, self.bounds.size.height-80);
        //圆角
        _imageView.layer.masksToBounds=YES;
        _imageView.layer.cornerRadius=10;
       
    }
    return _imageView;
}

-(UIView *)shadowView{
    if (_shadowView==nil) {
        _shadowView=[[UIView alloc]init];
        _shadowView.backgroundColor=[UIColor redColor];
        _shadowView.frame=CGRectMake(self.bounds.origin.x, self.bounds.origin.y+30, self.bounds.size.width, self.bounds.size.height-80);
        _shadowView.layer.shadowColor=[UIColor blackColor].CGColor;
        _shadowView.layer.shadowOffset=CGSizeMake(2, 2);
        _shadowView.layer.shadowOpacity=0.9;
        _shadowView.layer.cornerRadius=10;
        _shadowView.layer.shadowRadius=10;
        _shadowView.layer.masksToBounds=YES;
        _shadowView.clipsToBounds=NO;
    }
    return _shadowView;
}
@end
